SaveData["episode"] = SaveData["episode"] or {}


--------------------------------------------------
-- Level code
-- Created 17:41 2019-9-8
--------------------------------------------------

-- Have save so that when Toad arrives, he's already there, so the player doesn't Suffer.

-- Run code on level start
function onStart()
if globalsave.Destination then -- Opens doors if Birdo is defeated.
		triggerEvent("Destination")
	end
end

-- Run code every frame (~1/65 second)
-- (code will be executed before game logic will be processed)
function onTick()
    --Your code here
end

-- Run code when internal event of the SMBX Engine has been triggered
-- eventName - name of triggered event
function onEvent(eventName)
	if eventName == "Destination" then
		globalsave.Destination = true
	else
	if eventName == "Bridge Placed" then
		globalsave.BridgeLand = true
	end
end
end